package com.mcxx.convert;

import com.mcxx.modules.statistics.entity.StatisticsExportEntity;
import com.mcxx.modules.system.dto.StatisticsExportDTO;
import com.yinhai.ta404.core.security.vo.UserAccountVo;
import org.springframework.beans.BeanUtils;

import java.util.Date;


public class StatisticsConvert {


    public static StatisticsExportEntity convertStatisticsExportEntity(StatisticsExportDTO statisticsExportDTO, UserAccountVo userAccountVo){
        statisticsExportDTO.setOrgId(userAccountVo.getOrgId());
        statisticsExportDTO.setOperator(userAccountVo.getUsername());
        statisticsExportDTO.setExportTime(new Date());
        StatisticsExportEntity entity = new StatisticsExportEntity();

        BeanUtils.copyProperties(statisticsExportDTO, entity);

        return entity;
    }
}
